<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:a4j="http://richfaces.org/a4j"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets">
<body>
<ui:composition template="../template/templateAutenticado.xhtml">
	<ui:define name="central">
	<div align="center">
		<div align="left">
			<h:form>
				<h:commandLink action="PrincipalProfessor">
					<h:graphicImage value="/imagens/voltar.png" width="48" height="48" style="border:0px;"/>
				</h:commandLink>
			</h:form>
		</div>
		<br/>
		<rich:panel>
			<f:facet name="header">
				<h:outputText value="#{msg.CadastrarAula}" />
			</f:facet>
			<h:form id="formCadAula">
				<h:panelGrid columns="2">
					<h:outputText value="#{msg.Dia}" />
					<rich:calendar value="#{Professor.dataCompromisso}" showFooter="false"/>
					<h:outputText value="#{msg.Hora}" />
					<h:selectOneMenu value="#{Professor.horarioCompromisso}">
						<f:selectItem itemLabel="7:15" itemValue="07:15" />
						<f:selectItem itemLabel="7:25" itemValue="07:25" />
						<f:selectItem itemLabel="7:35" itemValue="07:35" />
						<f:selectItem itemLabel="7:45" itemValue="07:45" />
						<f:selectItem itemLabel="7:55" itemValue="07:55" />
						
						<f:selectItem itemLabel="8:05" itemValue="08:05" />
						<f:selectItem itemLabel="8:15" itemValue="08:15" />
						<f:selectItem itemLabel="8:25" itemValue="08:25" />
						<f:selectItem itemLabel="8:35" itemValue="08:35" />
						<f:selectItem itemLabel="8:45" itemValue="08:45" />
						<f:selectItem itemLabel="8:55" itemValue="08:55" />
						
						<f:selectItem itemLabel="9:05" itemValue="09:05" />
						<f:selectItem itemLabel="9:15" itemValue="09:15" />
						<f:selectItem itemLabel="9:25" itemValue="09:25" />
						<f:selectItem itemLabel="9:35" itemValue="09:35" />
						<f:selectItem itemLabel="9:45" itemValue="09:45" />
						<f:selectItem itemLabel="9:55" itemValue="09:55" />
						
						<f:selectItem itemLabel="10:05" itemValue="10:05" />
						<f:selectItem itemLabel="10:15" itemValue="10:15" />
						<f:selectItem itemLabel="10:25" itemValue="10:25" />
						<f:selectItem itemLabel="10:35" itemValue="10:35" />
						<f:selectItem itemLabel="10:45" itemValue="10:45" />
						<f:selectItem itemLabel="10:55" itemValue="10:55" />
	
						<f:selectItem itemLabel="11:05" itemValue="11:05" />
						<f:selectItem itemLabel="11:15" itemValue="11:15" />
						<f:selectItem itemLabel="11:25" itemValue="11:25" />
						<f:selectItem itemLabel="11:35" itemValue="11:35" />
						<f:selectItem itemLabel="11:45" itemValue="11:45" />
						<f:selectItem itemLabel="11:55" itemValue="11:55" />
		
						<f:selectItem itemLabel="13:15" itemValue="13:15" />
						<f:selectItem itemLabel="13:25" itemValue="13:25" />
						<f:selectItem itemLabel="13:35" itemValue="13:35" />
						<f:selectItem itemLabel="13:45" itemValue="13:45" />
						<f:selectItem itemLabel="13:55" itemValue="13:55" />
		
						<f:selectItem itemLabel="14:05" itemValue="14:05" />
						<f:selectItem itemLabel="14:15" itemValue="14:15" />
						<f:selectItem itemLabel="14:25" itemValue="14:25" />
						<f:selectItem itemLabel="14:35" itemValue="14:35" />
						<f:selectItem itemLabel="14:45" itemValue="14:45" />
						<f:selectItem itemLabel="14:55" itemValue="14:55" />
						<f:selectItem itemLabel="15:05" itemValue="15:05" />
		
						<f:selectItem itemLabel="15:15" itemValue="15:15" />
						<f:selectItem itemLabel="15:25" itemValue="15:25" />
						<f:selectItem itemLabel="15:35" itemValue="15:35" />
						<f:selectItem itemLabel="15:45" itemValue="15:45" />
						<f:selectItem itemLabel="15:55" itemValue="15:55" />
		
						<f:selectItem itemLabel="16:05" itemValue="16:05" />
						<f:selectItem itemLabel="16:15" itemValue="16:15" />
						<f:selectItem itemLabel="16:25" itemValue="16:25" />
						<f:selectItem itemLabel="16:35" itemValue="16:35" />
						<f:selectItem itemLabel="16:45" itemValue="16:45" />
						<f:selectItem itemLabel="16:55" itemValue="16:55" />
					
						<f:selectItem itemLabel="17:05" itemValue="17:05" />
						<f:selectItem itemLabel="17:15" itemValue="17:15" />
						<f:selectItem itemLabel="17:25" itemValue="17:25" />
						<f:selectItem itemLabel="17:35" itemValue="17:35" />
						<f:selectItem itemLabel="17:45" itemValue="17:45" />
						<f:selectItem itemLabel="17:55" itemValue="17:55" />
					</h:selectOneMenu>
					<h:outputText value="#{msg.Unidade} " />
					<h:selectOneMenu value="#{Professor.unidade}">
						<f:selectItem itemLabel="Unidade 1" itemValue="1" />
						<f:selectItem itemLabel="Unidade 2" itemValue="2" />
						<f:selectItem itemLabel="Unidade 3" itemValue="3" />
						<f:selectItem itemLabel="Unidade 4" itemValue="4" />
					</h:selectOneMenu>
				</h:panelGrid>
				<rich:dataTable />
				<h:commandButton action="#{Professor.cadastraCompromisso}" value="#{msg.Cadastrar}" />
			</h:form>
			</rich:panel>
			<br/>
			<h:form id="formTabelaCompromissoProfessor">
			<rich:dataTable value="#{Professor.compromissos}" var="compromisso" width="800px" rows="10" reRender="datascroller">
				<f:facet name="header">
					<h:outputText value="#{msg.AulasCadastradas}" />
				</f:facet>
				<rich:column sortBy="#{compromisso.dataHora}">
					<f:facet name="header">
						<h:outputText value="#{msg.Dia}" />
					</f:facet>
					<h:outputText value="#{compromisso.dataHora.time}">
					  	<f:convertDateTime type="date" pattern="dd/MM/yyyy"/> 
					</h:outputText>
				</rich:column>
				<rich:column sortBy="#{compromisso.dataHora}">
					<f:facet name="header">
						<h:outputText value="#{msg.Hora}" />
					</f:facet>
					<h:outputText value="#{compromisso.dataHora.time}">
						 <f:convertDateTime type="time" pattern="h:mm a" timeZone="#{Sessao.timeZone}" /> 
					</h:outputText>
				</rich:column>
				<rich:column sortBy="#{compromisso.professor.nome}">
					<f:facet name="header">
						<h:outputText value="#{msg.Professor}" />
					</f:facet>
					<h:outputText value="#{compromisso.professor.nome}" />
				</rich:column>
				<rich:column sortBy="#{compromisso.disponivel}">
					<f:facet name="header">
						<h:outputText value="#{msg.Disponibilidade}" />
					</f:facet>
					<h:outputText value="#{compromisso.disponivel}" />
				</rich:column>
				<rich:column sortBy="#{compromisso.unidade}">
					<f:facet name="header">
						<h:outputText value="#{msg.Unidade}" />
					</f:facet>
					<h:outputText value="#{compromisso.unidade}" />
				</rich:column>
				<rich:column>
					<f:facet name="header">
						<h:outputText value="#{msg.Excluir}" />
					</f:facet>
						<h:commandLink action="#{Professor.removeCompromisso}">
							<f:param name="Codigo" value="#{compromisso.codigo}"/>
							<h:outputText value="#{msg.Excluir}" />
						</h:commandLink>
				</rich:column>
				<f:facet name="footer">
                	<rich:datascroller id="datascroller" />
            	</f:facet>
			</rich:dataTable>
			</h:form>			
		
	</div>
	</ui:define>
</ui:composition>
</body>
</html>
